from OWAOperator.Operator import Operator
class OWA(Operator):
    def getResult(self):
        # 对数据进行简化
        data = self.data_list
        weight = self.weight_list
        # 对data 进行升序排列
        data = self.asc(data)
        # 获取初始值
        res = data[0] * weight[0]
        for i in range(1,len(data)):
            res += data[i] * weight[i]

        return res


if __name__ == '__main__':
    data_list = [343.30,412.71,389.42,372.68,363.49,363.28]
    weight_list = [0.10,0.10,0.15,0.15,0.20,0.30]
    pa = OWA(data_list)
    print(pa.getResult())


